package j.framework.tags.form;

import j.util.StringUtils;

import javax.servlet.jsp.JspException;

/**
 * 输入框tag
 * User: jason
 * Date: 2014/11/7 17:13
 */
public class InputTag extends BaseInputTag {

    private String type;

    @Override
    public String getInputType() {
        if(StringUtils.isNullOrEmpty(type)){
            return "text";
        }
        return type;
    }

    @Override
    public void writeInputTagValue(FormTagWriter writer, Object value)  throws JspException {
        if(null == value){
            value = getFormDataValue();
        }
        if(null!=value){
            writer.writeFormTagProperty("value",value.toString());
        }
    }


    @Override
    public String getCssClassName() {
        return null;
    }

    public void setType(String type) {
        this.type = type;
    }
}
